package com.gorun.wechat.utils;/**
 * Created by moneylee on 2019/4/19.
 */

import cn.hutool.core.util.StrUtil;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @className: MatcherUtil
 * @Description: 正则表达式匹配
 * @Author moneylee
 * @Date 2019/4/19 下午2:51
 * @Version 1.0
 **/
public class MatcherUtil {

    public static String match(String regex, String input) {
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(input);
        if (matcher.find()) {
            return matcher.group(1);
        }
        return null;
    }

}
